package com.example.denglu;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity2 extends AppCompatActivity {

    private Button button;
    private Button button2;
    private Button button3;

    private TextView textView;
    private TextView textView2;
    private TextView textView3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);

        button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setAction("android.intent.action.VIEW");
                intent.setData(Uri.parse("https://www.baidu.com"));
                startActivity(intent);
            }
        });

        button2 = (Button) findViewById(R.id.button2);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(getPackageManager().getLaunchIntentForPackage("tv.danmaku.bili"));
            }
        });

        button3 = (Button) findViewById(R.id.button3);
        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                startActivity(getPackageManager().getLaunchIntentForPackage("com.tencent.mobileqq"));
            }
        });

        Intent intent = getIntent();
        textView=(TextView) findViewById(R.id.textView);
        textView.setText(intent.getStringExtra("editTextTextPersonName"));

        textView2=(TextView) findViewById(R.id.textView2);
        textView2.setText(intent.getStringExtra("editTextTextPersonName2"));

        textView3=(TextView) findViewById(R.id.textView3);
        textView3.setText(intent.getStringExtra("editTextTextPersonName3"));
    }


}